package com.it.studyArrayExamples;

import java.util.ArrayList;
import java.util.Scanner;

public class Test {


    public static void main(String[] args) {

        //这是一个学生数组集合
        ArrayList<Student> students = new ArrayList<Student>();
        //学生信息录入
        Scanner scanner  = new Scanner(System.in);
        //录入信息
        for (int i = 0; i <3 ; i++) {
            System.out.println("请你录入信息：");
            String infor = scanner.next();
            int infor1 = scanner.nextInt();
            Student student1 = new Student(infor,infor1);
            //加入集合
            students.add(student1);
        }

        for (int i = 0; i < students.size(); i++) {
            Student students1 =students.get(i);
            System.out.println(students1.getAge()+students1.getName());
        }
    }

}
